package com.dslu.fx.service.impl;

import com.dslu.fx.dao.DzpAreaDao;
import com.dslu.fx.domain.DzpAreaDO;
import com.dslu.fx.service.DzpAreaService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;



@Service
public class DzpAreaServiceImpl implements DzpAreaService {
	@Autowired
	private DzpAreaDao dzpAreaDao;
	
	@Override
	public DzpAreaDO get(Integer id){
		return dzpAreaDao.get(id);
	}
	
	@Override
	public List<DzpAreaDO> list(Map<String, Object> map){
		return dzpAreaDao.list(map);
	}
	
	@Override
	public int count(Map<String, Object> map){
		return dzpAreaDao.count(map);
	}
	
	@Override
	public int save(DzpAreaDO dzpArea){
		return dzpAreaDao.save(dzpArea);
	}
	
	@Override
	public int update(DzpAreaDO dzpArea){
		return dzpAreaDao.update(dzpArea);
	}
	
	@Override
	public int remove(Integer id){
		return dzpAreaDao.remove(id);
	}
	
	@Override
	public int batchRemove(Integer[] ids){
		return dzpAreaDao.batchRemove(ids);
	}

    @Override
    public PageInfo<DzpAreaDO> getDzpAreaList(Map<String, Object> map) {
        PageHelper.startPage(map); //开始起始页
        List<DzpAreaDO> list = dzpAreaDao.getDzpAreaList(map); // 获取数据
        PageInfo<DzpAreaDO> page = new PageInfo<>(list); // 实例化PageInfo
        return page;
    }

    @Override
    public DzpAreaDO getOne(Map<String, Object> map){
        return dzpAreaDao.getOne(map);
    }

	@Override
	public List<DzpAreaDO> getDzpAreaListByCode(String code) {
		return dzpAreaDao.getDzpAreaListByCode(code);
	}

}
